﻿using System;
using System.Globalization;

namespace QuizzMe.ValueConverters
{
    /// <summary>
    /// Convert an icon name to the corresponding icon
    /// </summary>
    public class IconConverter : ImageConverter
    {
        #region Implementation of IValueConverter

        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return ImageFromResource((string) value);
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}